<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<style>
.editor table {
	display: inline;
	vertical-align: top;
}

</style>
<div class="r_location">
	<i class="r_txtico"></i> 内容管理&gt; 产品类型 &gt; 修改产品类型
</div>
<form id="add_form" action="cms/productType/modify"   method="post"  enctype="multipart/form-data" >
<input type="hidden" id="id" name="id" value="${data.id}" />

	<ul class="all_list">
		<li>
			<span class="all_title">类型名称：</span>
			<span>
				<input class="ui_input" id="name" validator='{"label":"名称","isDigit":false,"minLength":1,"maxLength":50}'  name="name" style="width:100px;" value="${data.name}"/>
			</span>
		</li>
		<li>
			<span class="all_title">类型名称：</span>
			<span>
				<input class="ui_input" id="type" validator='{"label":"类型","isDigit":false,"minLength":1,"maxLength":50}'  name="type" style="width:100px;" value="${data.type}"/>
			</span>
		</li>
		<li>
			<span class="all_title"></span>
			<span>
				<input type="button" id="addBtn" value="保存" class="btn_blue m-r15 submitBtn">
			</span>
		</li>
	</ul>
</form>
<script type="text/javascript">
	$(function(){
		function showDialog(url, options) {
			myDialog = art.dialog(options);// 初始化一个带有loading图标的空对话框
			$.post(url, options.param, function(data) {
				myDialog.content(data);
			});
		}
		$("#add_form").validator({}, {
			callback:function(data){
				if (!$('#name').val()) {
					alert("名称不能为空");
					return false;
				} 
				if (!$('#type').val()) {
					alert("类型不能为空");
					return false;
				}
				if(!$('#id').val()){
					alert("id不能为空");
					return false;
				}
				$("#add_form").ajaxSubmit(function(data){
					if (data.success == 'succeed') {
						to_page('/cms/productType/view/page');
					} else {
						art.dialog({icon: data.success,content: data.message,lock:true});
					}
				}); 
			}
		});
 	});
		
</script>